package vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries({ @NamedQuery(name = "Paper.findAll", query = "select e from Paper e order by year desc"),
		@NamedQuery(name = "Paper.findAllByTitle", query = "select e from Paper e where title like ? order by year desc"),
		@NamedQuery(name = "Paper.findTotalCount", query = "select count(*) from Paper e order by year desc"),
		@NamedQuery(name = "Paper.findTotalCountByTitle", query = "select count(*) from Paper e where title like ? order by year desc") })
@Table(name = "paper")
public class Paper extends BaseEntity {

	@Column(name = "title")
	private String title;

	@Column(name = "author")
	private String author;

	@Column(name = "source")
	private String source;

	@Column(name = "year")
	private String year;

	@Column(name = "affiliation")
	private String affiliation;

	@Column(name = "vol")
	private Integer vol;

	@Column(name = "no")
	private Integer no;

	@Column(name = "url")
	private String url;

	@JoinColumn(name = "type")
	@ManyToOne(fetch = FetchType.LAZY)
	private PaperType paperType;

	@Column(name = "created_at")
	private String createdAt;

	@Column(name = "sentenceCount")
	private Integer sentenceCount;
	
	@Column(name = "opinionCount")
	private Integer opinionCount;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getAffiliation() {
		return affiliation;
	}

	public void setAffiliation(String affiliation) {
		this.affiliation = affiliation;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public PaperType getPaperType() {
		return paperType;
	}

	public void setPaperType(PaperType paperType) {
		this.paperType = paperType;
	}

	public String getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(String createdAt) {
		this.createdAt = createdAt;
	}

	public Integer getVol() {
		return vol;
	}

	public void setVol(Integer vol) {
		this.vol = vol;
	}

	public Integer getNo() {
		return no;
	}

	public void setNo(Integer no) {
		this.no = no;
	}

	public Integer getSentenceCount() {
		return sentenceCount;
	}

	public void setSentenceCount(Integer sentenceCount) {
		this.sentenceCount = sentenceCount;
	}

	public Integer getOpinionCount() {
		return opinionCount;
	}

	public void setOpinionCount(Integer opinionCount) {
		this.opinionCount = opinionCount;
	}


}
